﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VideoCache.Server.BLL;
using VideoCache.Server.MVCWeb.Attributes;
using DbMapping.Common;
using VideoCache.Server.Model;

namespace VideoCache.Server.MVCWeb.Areas.Member.Controllers
{
    public class OrderController : Controller
    {
        //
        // GET: /Member/Order/
        [ActionAuthorize(AuthorizeType.Member)]
        public ActionResult Index()
        {
            Conditions cons = new Conditions();
            cons.Add(new ConditionItem(LinkType.And, OrderInfo.UseIdField, CompareType.Equal, 0));

            Orders orders = new Orders();
            orders.Add(new OrderItem(OrderInfo.CreateTimeField, OrderDirection.Desc));

            var list = OrderBLL.FindAll(cons, orders);

            return View(list);
        }
    }
}
